// 关系运算符重载
#include <iostream>
#include <string>
using namespace std;
class Person {
public:
    string m_name;
    int m_age;
    Person();
    Person(string name, int age);
    bool operator==(const Person &p) {
        if (this->m_name == p.m_name && this->m_age == p.m_age) {
            return true;
        }
        return false;
    }
};
Person::Person(){}
Person::Person(string name, int age) {
    this->m_name = name;
    this->m_age = age;
}
void test1() {
    Person p1("lxy", 20);
    Person p2("tom", 20);
    Person p3("lxy", 20);
    cout << "p1 == p2 : " << (p1 == p2) << endl;
    cout << "p1 == p3 : " << (p1 == p3) << endl; 
}
int main(void) {
    test1();

    return 0;
}